package com.leyou.page.controller;


import com.leyou.page.service.IPageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;


/**
 * @author xiuer
 * @description 商品详情页面展示微服务
 * @create 2019/7/3 15:36
 */

@Controller
public class PageController {

    @Autowired
    private IPageService pageService;

    @GetMapping("item/{id}.html")
    public String toItemView(@PathVariable("id") Long spuId, Model model) {
        model.addAllAttributes(pageService.loadingItemsBySpuId(spuId));
        return "item";

    }


}
